package com.wei.web.middleware.retry.compensate.mapper;

import com.tuya.biz.platform.framework.compensate.dataobject.MqCompensationDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @mbg.generated 表名: t_mq_compensation
 * @date 2021/04/26
 */
public interface MqCompensationMapper {
    /**
     * @mbg.generated
     */
    int deleteByPrimaryKey(Long id);

    /**
     * @mbg.generated
     */
    int insert(MqCompensationDO record);

    /**
     * @mbg.generated
     */
    MqCompensationDO selectByPrimaryKey(Long id);

    /**
     * @mbg.generated
     */
    List<MqCompensationDO> selectAll();

    /**
     * @mbg.generated
     */
    int updateByPrimaryKey(MqCompensationDO record);

    List<MqCompensationDO> selectFailedWorkGtId(@Param("id") Long id, @Param("dataIsolation") boolean dataIsolation);

    int suspendByPrimaryKey(Long id);

    int updateResultById(@Param("success") Boolean success, @Param("id") Long id);

    int updateRetryTimeByCAS(@Param("originalTime") Integer originalTime, @Param("id") Long id);

    int failedCountByTime(@Param("time") Long time, @Param("dataIsolation") boolean dataIsolation);

}
